import {get, post} from '../../util/request/requests'

export default{
  loadUsers (currentPage, pageSize) {
    return post({
      url: '/user/list',
      params: {
        current: currentPage,
        size: pageSize
      }
    })
  },
  loadUserRoles () {
    return get({
      url: '/menu/getUserRoles'
    })
  },
  loadRoles () {
    return get({
      url: '/menu/getRoles'
    })
  },
  updateUser (user) {
    return post({
      url: '/user/update',
      params: user
    })
  },
  deleteUser (userId) {
    return get({
      url: '/menu/getRoles',
      // 要以键值对的形式传参，不能只传一个数字
      params: {userId}
    })
  },
  resetPassword (id) {
    return post({
      url: '/user/update',
      params: {
        id: id,
        password: 123
      }
    })
  }
}
